<script type="text/javascript">
$(document).ready(function(){
  var currentPosition = 0;
  var slideWidth = 560;
  var slides = $('.slide');
  var numberOfSlides = slides.length;
    
  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');
  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }	
});
</script>
		
		  <!-- Slideshow HTML -->
  <div id="slideshow">
    <div id="slidesContainer">
      <div class="slide">
        <h2>'Tis the End, My Friend.</h2>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>OMG</p>
        <span>Votes:500</span>
        </div>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>WTH</p>
        <span>Votes:500</span>
        </div>
      </div>
      <div class="slide">
        <h2>'Tis the End, My Friend.</h2>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>OMG</p>
        <span>Votes:500</span>
        </div>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>WTH</p>
        <span>Votes:500</span>
        </div>
      </div>
      <div class="slide">
        <h2>'Tis the End, My Friend.</h2>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>OMG</p>
        <span>Votes:500</span>
        </div>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>WTH</p>
        <span>Votes:500</span>
        </div>
      </div>
      <div class="slide">
        <h2>'Tis the End, My Friend.</h2>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>OMG</p>
        <span>Votes:500</span>
        </div>
        <div>
        <img src="images/slide/img_slide_04.jpg" width="215" height="145" alt="Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril." />
        <p>WTH</p>
        <span>Votes:500</span>
        </div>
      </div>
    </div>
  </div>
  <!-- Slideshow HTML -->
		<div id="slide_bottom">
			<div id="random_vote">
				Random Votes:
                
			</div>
			<div id="share_batte">
				Share This Battle:		 
                    <div><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.smashlix.com" data-count="none">Tweet</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
                    </div>
                    <div><script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
                        <script type="IN/Share" data-url="http://smashlix.com/" data-counter="right"></script></div>
                    <div><a href="https://m.google.com/app/plus/x/?v=compose&content=http://smashlix.com/" onclick="window.open('https://m.google.com/app/plus/x/?v=compose&content=http://smashlix.com/','gplusshare','width=450,height=300,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;"><img src="images/plus.png" alt="Share on Google+" width="55" height="22" /></a></div>
                    <div style="top: -5px;"><a name="fb_share" type="button" share_url="http://www.smashlix.com/" style=""></a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></div>
			</div>
		</div>
	